<script src="<?php echo base_url().'assets/js/jquery.tablesorter.min.js'; ?>" type="text/javascript"></script>
<script type = "text/javascript">
	$(document).ready(function(){
		//delete ads
		$(".img-false").click(function(){
			//alert($(this).attr('id'));
			if (confirm("Are you sure you wish to delete this member?")) {
				/* $.ajax({
					url:'<?php echo base_url()?>',
				}); */
			}
			
		});
			
	});
</script>
<div class="content">
	<?php //echo form_open('admin/users/index', array('name'=>'adminForm','id'=>'adminForm')); ?>
	<div id="top-heading">
		<div id="h-links">
			<?php
			echo anchor(site_url(). 'admin/advertisements/create', 'Add New', 'id="add-new" class="button"');
			echo anchor('#', 'Delete', 'id="delete" class="button"');
			//echo form_input('search_text','','id="search-text"');
			//echo anchor('#','Search Users', 'id="search-btn" class="button"');
			?>
		</div>
		<div id="pagination">
			<?php echo $pagination; ?>
		</div>
	</div>

	<div id = "wrap-table">
		<table id = "adminTable" class = "admin-table">
			<thead>
				<tr>
					<th width='3%'><input type="checkbox" id="checkall" class="inputbox"/></th>
					<th width='5%'>ID</th>
					<th width='10%'>Banner</th>
					<th>Name</th>
					<th width='15%'>Section</th>
					<th width='15%'>Date</th>
					<th width='5%'>Publish</th>
					<th width='5%'>Action</th>
				</tr>
			</thead>
			<tbody>
			
			<?php foreach ($testi_qry_limited as $row): ?>
				<tr>
					<td><input type="checkbox" name="checkid[]" value="" class="checkbox" /></td>
					<td><?php echo $row->advertisementsid; ?></td>
					<td><img src = "<?php echo base_url().'assets/images'.$row->banner; ?>" width = "100%" height = "100%" /></td>
					<td><?php echo $row->name; ?></td>
					<td><?php echo $row->section; ?></td>
					<td><?php echo $row->date_added; ?></td>
					<td>
						<?php if($row->status == 0) : ?>
						<span class = "img-false" id="<?php echo $row->advertisementsid; ?>" >
							<img style="border:1px solid red;" src = "<?php echo base_url().'assets/images/wrong.png'?>" />
						</span>
						<?php else: ?>
						<span class = "img-true"><img src = "<?php echo base_url().'assets/images/check.png'?>" /></span>
						<?php endif; ?>
					</td>
					<td><a href = "<?php echo base_url();?>admin/advertisements/edit/<?php echo $row->advertisementsid;?>">edit</a></td>
				</tr>
				<?php endforeach; ?>
			</tbody>
		</table>
	</div><!--end of wrap-table-->
</div><!--end of content-->
